import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/home/index'
  },{
    path: '/home',
    name: 'home',
    component: () => import('../views/HomeView.vue'),
    children:[{
      path: 'index',
      name: '/home/index',
      component: () => import('../views/index/Index.vue')
    },{
      path: 'classify',
      name: '/home/classify',
      component: () => import('../views/classify/Classify.vue')
    },{
      path: 'shoppingcart',
      name: '/home/shoppingcart',
      component: () => import('../views/shoppingcart/Shoppingcart.vue')
    },{
      path: 'me',
      name: '/home/me',
      component: () => import('../views/me/Me.vue'),
    }]
  },{
    path: '/myorder',
    name: 'myorder',
    component: () => import('../views/me/MyOrder.vue')
},
{
  path: '/myfuli',
  name: 'myfuli',
  component: () => import('../views/me/myfuli.vue')
},
{
  path: '/myqiandao',
  name: 'myqiandao',
  component: () => import('../views/me/myqiandao.vue')
},
{
  path: '/address',
  name: 'address',
  component: () => import('../views/me/Address.vue')
},{
  path: '/collect',
  name: 'collect',
  component: () => import('../views/me/collect.vue')
},{
  path: '/address/add',
  name: 'add',
  component: () => import('../views/me/addAddress.vue')
},
{
  path: '/jiesuan',
  name: 'jiesuan',
  component: () => import('../views/shoppingcart/jiesuan.vue')
},
{
  path: '/shouyin',
  name: 'shouyin',
  component: () => import('../views/shoppingcart/shouyin.vue')
},
{
  path: '/Allshop',
  name: '/Allshop',
  component: () => import('../views/classify/Allshop.vue')
},
{
  path: '/ShopDetail',
  name: '/ShopDetail',
  component: () => import('../views/classify/ShopDetail.vue')
},
{
  path: '/IndexShopDetail',
  name: '/IndexShopDetail',
  component: () => import('../views/index/IndexShopDetail.vue')
},
{
  path: '/dizhi',
  name: '/dizhi',
  component: () => import('../views/shoppingcart/dizhi.vue')
},
{
  path: '/tianjiadizhi',
  name: '/tianjiadizhi',
  component: () => import('../views/shoppingcart/tianjiadizhi.vue')
},
{
  path: '/jiezhang',
  name: '/jiezhang',
  component: () => import('../views/shoppingcart/jiezhang.vue')
},
{
  path: '/search',
  name: '/search',
  component: () => import('../views/index/search.vue')
},
{
  path: '/setitem',
  name: '/setitem',
  component: () => import('../views/me/SetItem.vue')
},
{
  path: '/accountinfo',
  name: '/accountinfo',
  component: () => import('../views/me/accountInfo.vue')
},
{
  path: '/accountsecur',
  name: '/accountsecur',
  component: () => import('../views/me/accountSecur.vue')
},
{
  path: '/helpcenter',
  name: '/helpcenter',
  component: () => import('../views/me/helpCenter.vue')
},
{
  path: '/aboutus',
  name: '/aboutus',
  component: () => import('../views/me/AboutUs.vue')
},
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
